﻿namespace _4;

using System;
using System.Threading;

public class AlarmClock
{
    public event EventHandler Tick;
    public event EventHandler Alarm;
    

    protected virtual void OnTick()
    {
        Tick?.Invoke(this, EventArgs.Empty);
    }

    protected virtual void OnAlarm()
    {
        Alarm?.Invoke(this, EventArgs.Empty);
    }

    public void Start()
    {
        for (int i = 10; i > 0; i--)
        {
            OnTick();
            Thread.Sleep(1000);
        }
        OnAlarm();
    }
}
